/*
 * Software for Interactive Project Pool Game
 * Columbia University. New York, 2008
 * Authors:
 *   Abdulhamid Ghandour
 *   Thomas John
 *   Jaime Peretzman
 *   Bharadwaj Vellore
 * 
 * Desc:
 */
#ifndef _FIXED_POINT_H
#define _FIXED_POINT_H

#define FRAC_PRECISION         12
#define MAG_PRECISION          (64 - FRAC_PRECISION)

#define FPSUM(x,y)             ((x) + (y))
#define FPSUB(x,y)             ((x) - (y))
#define FPMUL(x,y)             (((x) * (y)) >> FRAC_PRECISION)
#define FPDIV(x,y)             (((x) << FRAC_PRECISION) / (y))
#define FPSQR(x)               FPMUL((x),(x))
#define FP2INT(x)              ((x) >> FRAC_PRECISION)
#define INT2FP(x)              ((x) << FRAC_PRECISION)

long long FPSQRT(long long num);
void printFP(long long fpnum);

#endif /* _FIXED_POINT_H */

